package listNodePractice;


public class Class78 {

    public ListNode oddEvenList(ListNode head) {

        if(head==null||head.next==null||head.next.next==null){
            return  head;
        }

        ListNode odd=head;
        ListNode even=head.next;
        while (odd!=null&&even!=null){
            odd.next=even.next;
            even.next=odd.next.next;
            odd=odd.next;
            even=even.next;
        }

        return  head;


    }


}
